//
//  bianjiTableViewCell.m
//  shifaOASystem
//
//  Created by michael on 2018/1/5.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "bianjiTableViewCell.h"

@implementation bianjiTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
 if (self) {
          self.selectionStyle = UITableViewCellSelectionStyleNone;

   _label = [[UILabel alloc]initWithFrame:CGRectZero];
   //CGRectMake(10, 0, 80, self.contentView.height)];
    _label.font = [UIFont systemFontOfSize:16];
//    _label.backgroundColor= [UIColor redColor];
    [self.contentView addSubview:_label];
    _label1 = [[UILabel alloc]init];
//    _label1.backgroundColor= [UIColor yellowColor];
    _label1.frame = CGRectZero;
           _label1.numberOfLines = 0;
      [_label1 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1];
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
           _label2.numberOfLines = 0;
      [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
      _textfield1 = [[zhucetextfield alloc]init];
              _textfield1.delegate = self;
         [self.contentView addSubview:_textfield1];
     
          _textfield2 = [[zhucetextfield alloc]init];
              _textfield2.delegate = self;
         [self.contentView addSubview:_textfield2];

     

}

    return self;

}


- (void)layoutSubviews
{
[super layoutSubviews];
CGFloat  titlesize1;
CGFloat  titlesize2;
if(_dic.count!=0){
titlesize1  = [OAToolBox sizebyText:_dic[@"morning"] font:13 minsWidth:60];
  titlesize2  = [OAToolBox sizebyText:_dic[@"afternoon"] font:13 minsWidth:60];
//    CGFloat  titlesize = titlesize2 +titlesize1;
    }else{
 titlesize1 = 30;
  titlesize2 = 30;
    
    }
// _label1.backgroundColor = [UIColor yellowColor];
  _label.frame = CGRectMake(20, 0, 100, 30);

 if(titlesize1>30){
_textfield1.frame = CGRectMake(50, _label.bottom, KScreenWidth-60,titlesize1);
//_label2.frame = CGRectMake(10, _label1.bottom, KScreenWidth-20,titlesize2);

 }
 else{
_textfield1.frame = CGRectMake(50, _label.bottom, KScreenWidth-60,30);
//_label2.frame = CGRectMake(10, _label1.bottom, KScreenWidth-20,30);

 
 }
 if(titlesize2>30){
//_label1.frame = CGRectMake(10, _label.bottom, KScreenWidth-20,titlesize1);
_textfield2.frame = CGRectMake(50, _textfield1.bottom, KScreenWidth-40,titlesize2);

 }
 else{
//_label1.frame = CGRectMake(10, _label.bottom, KScreenWidth-20,30);
_textfield2.frame = CGRectMake(50, _textfield1.bottom, KScreenWidth-60,30);

 
 }
 if(_dic.count!=0){

 _textfield1.text =_dic[@"morning"];
 _textfield2.text =_dic[@"afternoon"];
 }
 _label1.frame = CGRectMake(10, _label.bottom, 40,30);
_label2.frame = CGRectMake(10, _label1.bottom, 40,30);

    _label.text = [NSString stringWithFormat:@"%@ :",_week];

    _label1.text = [NSString stringWithFormat:@"上午:"];
    _label2.text = [NSString stringWithFormat:@"下午:"];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end

